FROM golang:1.13-alpine as builder

RUN go env -w GONOPROXY="gitlab.company.com,gitee.com" \
 && go env -w GONOSUMDB="gitlab.company.com" \
 && go env -w GOPROXY="https://goproxy.cn,direct"

WORKDIR /go/src

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -a -o web 

FROM alpine:latest as prod

WORKDIR /root/

COPY --from=0 /go/src/web .

CMD ["./web"]

EXPOSE 8081
